package com.itheima.stream流;

import java.util.ArrayList;

public class Demo1 {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<String>();
        list.add("林青霞");
        list.add("张曼玉");
        list.add("王祖贤");
        list.add("柳岩");
        list.add("张敏");
        list.add("张无忌");
        ArrayList<String> list1 = new ArrayList<String>();
        list.forEach((String s1) -> {
            if (s1.startsWith("张")) {
                list1.add(s1);
                System.out.println(s1+"...");
            }
        });
        System.out.println(".....................................");
        ArrayList<String> list2 = new ArrayList<String>();
        list1.forEach((String s) -> {
            if (s.length() == 3) {
                list2.add(s);
                System.out.println(s+"...");
            }
        });

    }
}
